package cn.com.ethos.search;

import java.io.IOException;
import java.util.Properties;


public class DbSetting {
	private java.util.Properties prop;
	
	/**
	 * @param propertiesPath default  "config.settings.properties"
	 * @throws IOException
	 */			
	public DbSetting(Properties prop){
		this.prop = prop;
	}
	public DbSetting(String dbUrl,String dbUser,String dbPass, String dbDriver){
		this.prop.put("db.user", dbUrl);
		this.prop.put("db.user", dbUser);
		this.prop.put("db.pass", dbPass);
		this.prop.put("db.driver", dbDriver);
	}
	
	public String getValue(String name) {
		return prop.getProperty(name);
	}
		
	public String getDbUrl() {
		return getValue("db.url");
	}
	public String getDbUser() {
		return getValue("db.user");
	}
	public String getDbPass() {
		return getValue("db.pass");
	}
	public String getDbDriver() {
		return getValue("db.driver");
	}
}
